//
//  CropProtectionViewController.m
//  AnXin100
//
//  Created by Sakura on 2018/11/12.
//  Copyright © 2018 tzhg. All rights reserved.
//

#import "CropProtectionViewController.h"

@interface CropProtectionViewController ()

@end

@implementation CropProtectionViewController

- (void)viewDidLoad {
    
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    NSArray *titleAry = @[@"幼树期",@"结果期",@"衰老期",@"树液流", @"萌芽期"];
    for (NSInteger i = 0; i < titleAry.count; i++) {
        
        UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
        btn.frame = CGRectMake(SCREEN_WIDTH / 5 * i, 0, SCREEN_WIDTH / 5, 30);
        [btn setTitle:titleAry[i] forState:UIControlStateNormal];
        [btn setTitleColor:COLOR_Gray forState:UIControlStateNormal];
        [btn setTitleColor:COLOR_GREEN forState:UIControlStateSelected];
        btn.titleLabel.font = [UIFont systemFontOfSize:14];
        btn.tag = 100 + i;
        if (i == 0) {
            btn.selected = YES;
        }
        [self.view addSubview:btn];
        [btn addTarget:self action:@selector(clickAciton:) forControlEvents:UIControlEventTouchUpInside];
    }
}

@end
